Skip to content

UpdateTrustedProxiesMiddleware to support CIDR blocks#7

Merged
heedaeshin merged 1 commit intomainfrom
feature/add-cidr-block-support
Aug 20, 2024
Merged

UpdateTrustedProxiesMiddleware to support CIDR blocks#7
heedaeshin merged 1 commit intomainfrom
feature/add-cidr-block-support

Conversation

@heedaeshin
Copy link
Copy Markdown
Contributor

@heedaeshin heedaeshin commented Aug 20, 2024

P 주소 및 CIDR 블록 지원을 명확히 하기 위해 --allow-ip 플래그의 도움말 메시지 개선

  • --allow-ip 플래그의 도움말 메시지를 업데이트하여 IP 주소와 CIDR 블록 모두를 지원함을 표기
  • 더 나은 이해를 위해 예제를 제공
  • 이전: 클라이언트 IP가 신뢰할 수 있는 프록시 중 하나로 시작하는지 확인 후 next
  • 이후: 클라이언트 IP와 신뢰할 수 있는 프록시를 CIDR 블록으로 파싱하고 클라이언트 IP가 신뢰할 수 있는 CIDR 범위 내에 있는지 확인함
  • 유효하지 않은 IP 주소 처리 및 서브넷 마스크가 지정되지 않은 경우 /32를 추가하는 기능을 추가

- Updated the help message for the --allow-ip flag to clearly indicate that both IP addresses and CIDR blocks are supported.
- Provided examples for better understanding.

Update TrustedProxiesMiddleware to support CIDR blocks

- Before: Checked if client IP starts with any of the trusted proxies.
- After: Parses client IP and trusted proxies as CIDR blocks and checks if client IP is within any of the trusted CIDR ranges.
- Added handling for invalid IP addresses and appending /32 if no subnet mask is specified.
@heedaeshin heedaeshin merged commit 482599a into main Aug 20, 2024
@heedaeshin heedaeshin deleted the feature/add-cidr-block-support branch August 22, 2024 06:37
JH-Lee-cloudlab added a commit that referenced this pull request Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant